|
|
|
|
|
|
|
Of the major operating systems currently in use (and no, we will no longer consider 16-bit systems, even though there are many still in use), Windows 95 and NT 3.51 are the least capable. Both lack functions available under NT 4, 5, and Windows 98, and both lack functions that the other supports. Figure P8-1 shows a rough outline of the overlap of functions. As you can see, each version of Windows NT builds on the API set of earlier versions. Windows NT as of version 4.0 contains most of the functions from Windows 95 and Windows 98, but the reverse is emphatically not true. Windows 98 supports more NT functionality than Windows 95, but nowhere near all of it. |
|
|
|
|
|
|
|
|
Win32 applications use the GetVersionEx function to obtain detailed version information from the operating system. |
|
|
|
|
|
|
|
|
The GetVersionEx function is defined as follows in the Windows documentation: |
|
|
|
 |
|
 |
|
|
The GetVersionEx function obtains extended information about the version of the operating system that is currently running. |
|
|
|
 |
|
|
|
|
BOOL GetVersionEx( LPOSVERSIONINFO lpVersionInformation // pointer to version
// information structure ); |
|
|
|
|
|
|
|
|
The function takes as a parameter a pointer to an OSVERSIONINFO structure, which is defined as follows: |
|
|
|
|
|
|
|
|
typedef struct _OSVERSIONINFO{
DWORD dwOSVersionInfoSize; ' The size of the structure
DWORD dwMajorVersion; ' The major version number
DWORD dwMinorVersion; ' The minor version number
DWORD dwBuildNumber; ' The build number
DWORD dwPlatformId; ' A platform identifier
TCHAR szCSDVersion[ 128 ]; ' A string describing additional
' information
} OSVERSIONINFO; |
|
|
|
|
|
|
|
|
The platform ID is one of the following constants: |
|
|
|
|
| VER_PLATFORM_WIN32_WINDOWS | Win32 on Windows 95 or Windows 98 | | VER_PLATFORM_WIN32_NT | Win32 on Windows NT | | VER_PLATFORM_WIN32_CE | Win32 on Windows CE |
|
|
|